(function($){ 'use strict'; var pluginName="storeLocatorSingle", defaults={ map_container: "#store_locator_single_map", map_min_height: 300, earthRadi: { mi: 3963.1676, km: 6378.1, ft: 20925524.9, mt: 6378100, "in": 251106299, yd: 6975174.98, fa: 3487587.49, na: 3443.89849, ch: 317053.408, rd: 1268213.63, fr: 31705.3408 }, }; function Plugin(element, options){ this.element=element; this.settings=$.extend({}, defaults, options); this._defaults=defaults; this.settings.lat=$(element).data('lat'); this.settings.lng=$(element).data('lng'); this._name=pluginName; this.init(); } $.extend(Plugin.prototype, { init: function(){ var that=this; this.window=$(window); this.documentHeight=$(document).height(); this.windowHeight=this.window.height(); this.settings.mapDefaultZoom=parseInt(that.settings.mapDefaultZoom); this.templateCache={}; that.initStoreLocatorSingle(); }, initStoreLocatorSingle: function(){ var that=this; that.initMap(function(){ that.createMarker(); }); }, initMap: function(callback){ var mapContainer=$(this.settings.map_container); var mapDefaultZoom=this.settings.mapDefaultZoom; var mapDefaultType=this.settings.mapDefaultType; var mapDefaultLat=Number(this.settings.lat); var mapDefaultLng=Number(this.settings.lng); var mapStyling=this.settings.mapStyling; if(!this.isEmpty(mapStyling)){ mapStyling=JSON.parse(mapStyling); }else{ mapStyling=""; } this.map=new google.maps.Map(mapContainer[0], { zoom: mapDefaultZoom, center: new google.maps.LatLng(mapDefaultLat, mapDefaultLng), mapTypeId: google.maps.MapTypeId[mapDefaultType], scrollwheel: false, styles: mapStyling }); callback(); }, createMarker: function(){ var marker; var store={}; store.map=this.map; store.position=new google.maps.LatLng(this.settings.lat, this.settings.lng); store.icon=this.settings.mapDefaultIcon; marker=new google.maps.Marker(store); marker.setMap(this.map); }, isEmpty: function(obj){ if(obj==null) return true; if(obj.length > 0) return false; if(obj.length===0) return true; for (var key in obj){ if(hasOwnProperty.call(obj, key)) return false; } return true; }, sprintf: function parse(str){ var args=[].slice.call(arguments, 1), i=0; return str.replace(/%s/g, function(){ return args[i++]; }); }, getCookie: function(cname){ var name=cname + "="; var ca=document.cookie.split(';'); for(var i=0; i 0){ for (i; i < storesLength; i++){ store=stores[i]; store.map=this.map; this.store=store; store.position=new google.maps.LatLng(store.lat, store.lng); if(!that.isEmpty(store.ic)){ store.icon=store.ic; }else if(!that.isEmpty(that.settings.store_locator_category_icon)){ store.icon=that.settings.store_locator_category_icon; }else{ store.icon=that.settings.mapDefaultIcon; } marker=new google.maps.Marker(store); this.markers.push(marker); if(this.settings.infowindowEnabled==="1"){ this.createInfowindow(marker, map, infowindow, store); }} }}, createInfowindow: function(marker, map, infowindow, store){ var that=this; var infowindowLinkAction=this.settings.infowindowLinkAction; store.infowindowAction=store.gu; if(infowindowLinkAction=="web"){ store.infowindowAction=store.we; } if(infowindowLinkAction=="tel"){ store.infowindowAction='tel:' + store.te; } if(infowindowLinkAction=="email"){ store.infowindowAction='mailto:' + store.em; } var content='
' + '
'; if(this.settings.infowindowLinkAction!=="none"){ content +='' + '

' + store.na + '

' + '
'; }else{ content +='

' + store.na + '

'; } content += !that.isEmpty(store.dc) ? '' + that.settings.showDistanceText + ': ' + store.dc + '
':''; content +='

'; if(that.settings.showAddressStyle=="american"){ content += !that.isEmpty(store.st) ? '' + store.st + '
':''; content += !that.isEmpty(store.ct) ? '' + store.ct + ', ':''; content += !that.isEmpty(store.rg) ? '' + store.rg + ' ':''; content += !that.isEmpty(store.zp) ? '' + store.zp + '
':''; content += !that.isEmpty(store.co) ? '' + store.co + '':''; }else{ content += !that.isEmpty(store.st) ? '' + store.st + '
':''; content += !that.isEmpty(store.zp) ? '' + store.zp + '':''; content += !that.isEmpty(store.ct) ? '' + store.ct + '
':''; content += !that.isEmpty(store.rg) ? '' + store.rg + '':''; content += !that.isEmpty(store.co) ? '' + store.co + '':''; } content +='

' + '

'; content += !that.isEmpty(store.te) ? '' + that.settings.showTelephoneText + ': ' + store.te + '
':''; content += !that.isEmpty(store.em) ? '' + that.settings.showEmailText + ': ' + store.em + '
':''; content += !that.isEmpty(store.mo) ? '' + that.settings.showMobileText + ': ' + store.mo + '
':''; content += !that.isEmpty(store.fa) ? '' + that.settings.showFaxText + ': ' + store.fa + '
':''; content += !that.isEmpty(store.we) ? '' + that.settings.showWebsiteText + ': ' + store.we + '
':''; content +='

' + '

'; content += !that.isEmpty(store.lat) ? ' '+that.settings.showGetDirectionText+'':''; content += !that.isEmpty(that.settings.showContactStorePage) ? ' '+that.settings.showContactStoreText+'':''; content += !that.isEmpty(store.te) ? ' '+that.settings.showCallNowText+'':''; content += !that.isEmpty(store.we) ? ' '+that.settings.showVisitWebsiteText+'':''; content += !that.isEmpty(store.em) ? ' '+that.settings.showWriteEmailText+'':''; content +='

' + '
'; content += !that.isEmpty(store.im) ? '
':''; if(!that.isEmpty(store.op)){ content +='
' + that.createOpeningHoursTable(store.op)+ '
'; } content += !that.isEmpty(store.de) ? '
' + '' + store.de + '' + '
':''; content +='
'; marker.addListener('click', function(){ if(!that.isEmpty(store.ic)){ this.setIcon(store.ic); }else if(!that.isEmpty(that.settings.store_locator_category_icon)){ this.setIcon(that.settings.store_locator_category_icon); }else{ this.setIcon(that.settings.mapDefaultIconHover); } infowindow.setContent(content); infowindow.open(map, this); if(that.settings.mapPanToOnHover=="1"){ that.map.panTo(this.getPosition()); } google.maps.event.addListener(map, 'click', function(){ infowindow.close(); }); google.maps.event.addListener(that.radiusCircle, 'click', function(){ infowindow.close(); }); }); marker.addListener('mouseover', function(){ if(that.settings.infowindowCheckClosed=="1"){ if(!that.isInfoWindowOpen(infowindow)){ google.maps.event.trigger(this, 'click'); }}else{ google.maps.event.trigger(this, 'click'); }}); marker.addListener('mouseout', function(){ if(!that.isEmpty(store.ic)){ this.setIcon(store.ic); }else if(!that.isEmpty(that.settings.store_locator_category_icon)){ this.setIcon(that.settings.store_locator_category_icon); }else{ this.setIcon(that.settings.mapDefaultIcon); }}); }, createResultList: function(stores){ var that=this; var storesLength=Object.keys(stores).length; var resultList=$(this.settings.result_list); var resultListIconEnabled=this.settings.resultListIconEnabled; var resultListIcon=this.settings.resultListIcon; var resultListIconSize=this.settings.resultListIconSize; var resultListIconColor=this.settings.resultListIconColor; var resultListPremiumIconEnabled=this.settings.resultListPremiumIconEnabled; var resultListPremiumIcon=this.settings.resultListPremiumIcon; var resultListPremiumIconSize=this.settings.resultListPremiumIconSize; var resultListPremiumIconColor=this.settings.resultListPremiumIconColor; var resultListLinkAction=this.settings.resultListLinkAction; var store; var i=0; var content; var filterBadges; resultList.html(''); if(storesLength > 0){ for (i; i < storesLength; i++){ store=stores[i]; content=''; if(resultListIconEnabled==="1"){ content +='
' + '' + '
' + '
'; }else if(that.settings.showImage=="1"&&store.im){ content +='
'; content += !that.isEmpty(store.im) ? '':''; content +='
'; content +='
'; }else{ content +='
'; } var resultListLinkAction=this.settings.resultListLinkAction; store.resultListLinkAction=store.gu; if(resultListLinkAction=="web"){ store.resultListLinkAction=store.we; } if(resultListLinkAction=="tel"){ store.resultListLinkAction='tel:' + store.te; } if(resultListLinkAction=="email"){ store.resultListLinkAction='mailto:' + store.em; } if(this.settings.resultListLinkAction!=="none"){ content +='' + '

' + store.na + '

' + '
'; }else{ content +='

' + store.na + '

'; } content += !that.isEmpty(store.dc) ? '' + that.settings.showDistanceText + ': ' + store.dc + '
':''; filterBadges=""; if(!that.isEmpty(store.fi)){ $.each(store.fi, function(i, item){ filterBadges +=that.createBadge(item); }); } if(!that.isEmpty(store.ca)){ $.each(store.ca, function(i, item){ filterBadges +=that.createBadge(item); }); } content += !that.isEmpty(filterBadges) ? '' + filterBadges + '
':''; '

'; if(that.settings.showAddressStyle=="american"){ content += !that.isEmpty(store.st) ? '' + store.st + '
':''; content += !that.isEmpty(store.ct) ? '' + store.ct + ', ':''; content += !that.isEmpty(store.rg) ? '' + store.rg + ' ':''; content += !that.isEmpty(store.zp) ? '' + store.zp + '
':''; content += !that.isEmpty(store.co) ? '' + store.co + '':''; }else{ content += !that.isEmpty(store.st) ? '' + store.st + '
':''; content += !that.isEmpty(store.zp) ? '' + store.zp + '':''; content += !that.isEmpty(store.ct) ? '' + store.ct + '
':''; content += !that.isEmpty(store.rg) ? '' + store.rg + '':''; content += !that.isEmpty(store.co) ? '' + store.co + '':''; } content +='

' + '

'; content += !that.isEmpty(store.te) ? '' + that.settings.showTelephoneText + ': ' + store.te + '
':''; content += !that.isEmpty(store.em) ? '' + that.settings.showEmailText + ': ' + store.em + '
':''; content += !that.isEmpty(store.mo) ? '' + that.settings.showMobileText + ': ' + store.mo + '
':''; content += !that.isEmpty(store.fa) ? '' + that.settings.showFaxText + ': ' + store.fa + '':''; content += !that.isEmpty(store.dc) ? '' + that.settings.showDistanceText + ': ' + store.dc + '
':''; content += !that.isEmpty(store.we) ? '' + that.settings.showWebsiteText + ': ' + store.we + '
':''; content +='

'; content += !that.isEmpty(store.de) ? '
' + '

' + store.de + '

' + '
':''; content +='

'; content += !that.isEmpty(store.lat) ? ' '+that.settings.showGetDirectionText+'':''; content += !that.isEmpty(that.settings.showContactStorePage) ? ' '+that.settings.showContactStoreText+'':''; content += !that.isEmpty(store.te) ? ' '+that.settings.showCallNowText+'':''; content += !that.isEmpty(store.we) ? ' '+that.settings.showVisitWebsiteText+'':''; content += !that.isEmpty(store.em) ? ' '+that.settings.showWriteEmailText+'':''; content +=' '+ that.settings.showShowOnMapText + ''; content +='

'; var render=''; render='
' + '
'; render +=content; if(resultListPremiumIconEnabled==="1"&&store.pr==="1"){ render +=''; } render +='
' + '
'; resultList.append(render); }}else{ if(this.settings.mapExtendRadius==="1"){ if(!$(this.settings.store_locator_filter_radius + " option:last").is(":selected")){ $(this.settings.store_locator_filter_radius + ' option:selected').prop('selected', false).next().prop('selected', 'selected').trigger('change'); }else{ this.noResults(); }}else{ this.noResults(); }} this.autoHeightMap(); this.map.setCenter(this.currentPosition); this.window.trigger('resize'); if(this.settings.resultListHover=="1"){ this.resultItemHover(); } if(this.settings.showShowOnMap=="1"){ this.showOnMap(); }}, createOpeningHoursTable: function(openingHours){ var that=this; var table=''; $.each(openingHours, function(i, item){ if(that.isEmpty(item)){ return true; } if(i % 2===0){ table +='
'; table +='
'; } if(i % 2===0){ if(i==="0"){ table +=that.settings.showOpeningHoursMonday; } if(i==="2"){ table +=that.settings.showOpeningHoursTuesday; } if(i==="4"){ table +=that.settings.showOpeningHoursWednesday; } if(i==="6"){ table +=that.settings.showOpeningHoursThursday; } if(i==="8"){ table +=that.settings.showOpeningHoursFriday; } if(i==="10"){ table +=that.settings.showOpeningHoursSaturday; } if(i==="12"){ table +=that.settings.showOpeningHoursSunday; } table +=': ' + item; }else{ table +=" - " + item + ' ' + that.settings.showOpeningHoursClock; } if(i % 2!==0){ table +='
'; table +='
'; }}); if(!that.isEmpty(table)){ var title='

' + that.settings.showOpeningHoursText + '

'; table='
' + table + '
'; table=title + table; } return table; }, createBadge: function(value){ var that=this; var badgeCSS=that.slugify(value); var template='%s '; return that.sprintf(template, value); }, noResults: function(){ var resultList=$(this.settings.result_list); resultList.html(''); resultList.append('

' + this.settings.resultListNoResultsText + '

'); this.autoHeightMap(); }, resultItemHover: function(){ var that=this; var resultList=$(this.settings.result_list); $('.store_locator_result_list_item').each(function(i, item){ $(item).on('mouseenter', function(){ google.maps.event.trigger(that.markers[i], 'click'); }); }); }, showOnMap: function(){ var that=this; var resultList=$(this.settings.result_list); $('.store_locator_show_on_map').each(function(i, item){ $(item).on('click', function(){ google.maps.event.trigger(that.markers[i], 'click'); }); }); }, initFilter: function(){ var that=this; var store_locator_filter_open_close=$(this.settings.store_locator_filter_open_close); var store_locator_filter_icon=store_locator_filter_open_close.find('i'); store_locator_filter_open_close.on('click', function(){ that.maybeShowFilter(); }); that.watchRadiusSelection(); that.watchCategoriesSelection(); that.watchCheckboxFilter(); that.updateActiveFilter(); }, maybeShowFilter: function(){ var store_locator_filter_content=$(this.settings.store_locator_filter_content); var store_locator_filter_open_close=$(this.settings.store_locator_filter_open_close); var store_locator_filter_icon=store_locator_filter_open_close.find('i'); if(store_locator_filter_content.is(":hidden")){ store_locator_filter_icon.removeClass('fa-chevron-down'); store_locator_filter_icon.addClass('fa-chevron-up'); store_locator_filter_content.fadeIn(); }else{ store_locator_filter_icon.addClass('fa-chevron-down'); store_locator_filter_icon.removeClass('fa-chevron-up'); store_locator_filter_content.fadeOut(); }}, watchRadiusSelection: function(){ var that=this; var selectedRadius=$(this.settings.store_locator_filter_radius); selectedRadius.on('change', function(){ that.drawRadiusCircle(); that.updateActiveFilter(); that.getStores(); }); var predefinedRadius=that.getParameterByName('radius'); if(!that.isEmpty(predefinedRadius)){ var options=selectedRadius.find('option'); $.each(options, function(i, index){ var option=$(this); option.prop('selected', false); if(option.val()==predefinedRadius){ option.prop('selected', true); }}); }}, watchCategoriesSelection: function(){ var that=this; var selectedCategories=$(this.settings.store_locator_filter_categories); if(selectedCategories.length==0){ var selectedCategories=$('.store_locator_category_filter_image'); var selectedCategoryID=$('.store_locator_category_filter_image[data-selected="selected"]').data('category'); if(selectedCategoryID > 0){ that.categories={0: selectedCategoryID };} selectedCategories.on('click', function(){ var selected=$(this); selectedCategoryID=selected.data('category'); var categoryIcon=$(selected).data('icon'); if(!that.isEmpty(categoryIcon)){ that.settings.store_locator_category_icon=categoryIcon; }else{ that.settings.store_locator_category_icon=''; } that.categories={0: selectedCategoryID }; that.updateActiveFilter(); that.getStores(); }); }else{ var selectedCategoryID=selectedCategories.find(':selected').val(); var predefinedCategory=that.getParameterByName('category'); if(!that.isEmpty(predefinedCategory)){ var tst=selectedCategories.val(predefinedCategory); selectedCategoryID=predefinedCategory; } that.categories={0: selectedCategoryID }; selectedCategories.on('change', function(){ var selected=selectedCategories.find(':selected'); selectedCategoryID=selected.val(); var categoryIcon=$(selected).data('icon'); if(!that.isEmpty(categoryIcon)){ that.settings.store_locator_category_icon=categoryIcon; }else{ that.settings.store_locator_category_icon=''; } that.categories={0: selectedCategoryID }; that.updateActiveFilter(); that.getStores(); }); }}, watchCheckboxFilter: function(){ var that=this; var filterCheckboxes=$(this.settings.store_locator_filter_checkbox); var predefinedFilter=that.getQuerystringData('filter[]'); if(typeof predefinedFilter=='string'){ predefinedFilter={0:predefinedFilter};} if(typeof predefinedFilter=='undefined'){ predefinedFilter={};} filterCheckboxes.each(function(i, item){ var checkbox=$(item); if(!that.isEmpty(predefinedFilter)){ $.each(predefinedFilter, function(i, index){ if(checkbox.prop('name')==index){ checkbox.prop('checked', 'checked'); }}); } var isChecked=checkbox.is(":checked"); if(isChecked){ var filter=checkbox.prop("name"); that.filter[filter]=filter; }}); $(filterCheckboxes).on('change', function (){ that.filter={}; filterCheckboxes.each(function(i, item){ var checkbox=$(item); var isChecked=checkbox.is(":checked"); if(isChecked){ var filter=checkbox.prop("name"); that.filter[filter]=filter; }}); that.updateActiveFilter(); that.getStores(); }); }, updateActiveFilter: function(){ var that=this; var store_locator_filter=$(this.settings.store_locator_filter); var store_locator_filter_active_filter=$(this.settings.store_locator_filter_active_filter); var selectedCategories=store_locator_filter.find('select'); var selectedFilters=store_locator_filter.find('input:checked'); var template='%s '; var append=""; store_locator_filter_active_filter.html(''); selectedCategories.each(function(i, item){ var val=$(item).find(':selected').val(); if(val!==""){ var text=$(item).find(':selected').text(); var slug=that.slugify(text); append=append + that.sprintf(template, slug, text); }}); selectedFilters.each(function(i, item){ var text=$(item).val(); var slug=that.slugify(text); append=append + that.sprintf(template, slug, text); }); store_locator_filter_active_filter.html(append); }, watchResize: function(){ var store_locator_sidebar=$(this.settings.store_locator_sidebar); var store_modal_close=$(this.settings.store_modal_close); var windowWidth=this.window.width(); var top; }, watchMapDragged:function(){ var that=this; var map=that.map; var store_locator_dragged_button=$(that.settings.store_locator_dragged_button); store_locator_dragged_button.fadeOut(); google.maps.event.addListener(map, 'dragend', function(e){ store_locator_dragged_button.fadeIn(); }); }, watchDraggedButton:function (){ var that=this; var store_locator_dragged_button=$(that.settings.store_locator_dragged_button); store_locator_dragged_button.on('click', function(e){ store_locator_dragged_button.fadeOut(); var coords=that.map.getCenter(); var currentPosition=new google.maps.LatLng(coords.lat(), coords.lng()); that.setCurrentPosition(currentPosition); }); }, radiusToZoom: function(radius){ return Math.round(14-Math.log(radius)/Math.LN2); }, initForm:function(){ var that=this; var predefinedAddress=that.getParameterByName('address'); var predefinedLat=that.getParameterByName('lat'); var predefinedLng=that.getParameterByName('lng'); var addressField=$(this.settings.store_locator_form_customer_address); var address=addressField.val(); var lat, lng; if(!that.isEmpty(predefinedAddress)&&that.isEmpty(address)){ addressField.val(predefinedAddress); } if(!that.isEmpty(predefinedLat)&&!that.isEmpty(predefinedLng)){ lat=predefinedLat; lng=predefinedLng; } that.watchFormSelectField(); that.watchFormAddressField(); that.initFormAutocomplete(); that.loadFormStores(lat, lng); }, loadFormStores:function(lat, lng){ var that=this; var storeSelectField=$(this.settings.store_locator_form_store_select); var addressField=$(this.settings.store_locator_form_customer_address); var address=addressField.val(); var predefinedStoreId=that.getParameterByName('store_id'); if((that.isEmpty(lat)||that.isEmpty(lng))&&!that.isEmpty(address)){ that.geocoder.geocode({ 'address': address }, function(results, status){ if(status===google.maps.GeocoderStatus.OK){ var location=results[0].geometry.location; lat=location.lat(); lng=location.lng(); that.getAllStores(lat, lng, that.storesToSelectField, { store_id:predefinedStoreId, that: that}); }else{ that.getAllStores(lat, lng, that.storesToSelectField, { store_id:predefinedStoreId, that: that}); }}); }else{ that.getAllStores(lat, lng, that.storesToSelectField, { store_id:predefinedStoreId, that: that}); }}, watchFormAddressField:function(){ var that=this; var addressField=$(this.settings.store_locator_form_customer_address); addressField.on('focusout', function(e){ var $this=$(this); var val=$this.val() that.loadFormStores(); }); }, watchFormSelectField:function (){ var that=this; var storeSelectField=$(this.settings.store_locator_form_store_select); var dataName, dataValue; storeSelectField.on('change', function(e){ var $this=$(this); var selected=storeSelectField.find(':selected'); var val=$this.val() var possibleData=[ 'name', 'address', 'zip', 'city', 'country', 'region', 'telephone', 'mobile', 'fax', 'email', 'website', ] $(possibleData).each(function(i, index){ var dataName=index; var dataValue=selected.data(dataName); if(typeof dataValue!=='undefined'){ dataValue=dataValue.toString(); } if(that.isEmpty(dataValue)){ dataValue=""; } var inputField=$('input[name="store_locator_form_store_' + dataName + '"]'); if(inputField.length > 0){ inputField.val(dataValue); } var infoField=$('.store_locator_store_info_' + dataName); if(infoField.length > 0){ infoField.html(dataValue); }}); }); }, getAllStores: function(lat, lng, callback, options){ var that=this; jQuery.ajax({ url: that.settings.ajax_url, type: 'post', dataType: 'JSON', data: { action: 'get_all_stores', lat: lat, lng: lng, }, success:function(response){ callback(response, options); }, error: function(jqXHR, textStatus, errorThrown){ alert('An Error Occured: ' + jqXHR.status + ' ' + errorThrown + '! Please contact System Administrator!'); }}); }, initFormAutocomplete: function(){ var that=this; var addressField=$(this.settings.store_locator_form_customer_address); var countryRestrict=this.settings.autocompleteCountryRestrict; var type=this.settings.autocompleteType; var map=this.map; if(!addressField){ return; } var autocompleteOptions={}; if(!that.isEmpty(countryRestrict)){ autocompleteOptions.componentRestrictions={'country':countryRestrict };} if(!that.isEmpty(type)){ autocompleteOptions.types=[type]; }else{ autocompleteOptions.types=['geocode']; } var autocomplete=new google.maps.places.Autocomplete(addressField[0], autocompleteOptions); autocomplete.addListener('place_changed', function(e){ var place=autocomplete.getPlace(); if(!that.isEmpty(place.formatted_address)){ addressField.val(place.formatted_address).trigger('focusout'); }else{ addressField.val(place.name).trigger('focusout'); }}); }, storesToSelectField: function(stores, options){ var that=options.that; var store_id=options.store_id var storeSelectField=$(that.settings.store_locator_form_store_select); var html=''; var storesLength=Object.keys(stores).length; var i=0; var store; var selected; var data; var disabled; if(storesLength > 0){ for (i; i < storesLength; i++){ store=stores[i]; selected=""; if(store.ID==store_id){ selected='selected="selected"'; } data=""; if(!that.isEmpty(store.na)){ data +=' data-name="' + store.na + '"'; if(!that.isEmpty(store.distance)){ store.distance=parseFloat(store.distance).toFixed(2); store.na=store.na + ' (' + store.distance + ' ' + that.settings.mapDistanceUnit + ')'; }} if(!that.isEmpty(store.st)){ data +=' data-address="' + store.st + '"'; } if(!that.isEmpty(store.zp)){ data +=' data-zip="' + store.zp + '"'; } if(!that.isEmpty(store.ct)){ data +=' data-city="' + store.ct + '"'; } if(!that.isEmpty(store.co)){ data +=' data-country="' + store.co + '"'; } if(!that.isEmpty(store.rg)){ data +=' data-region="' + store.rg + '"'; } if(!that.isEmpty(store.te)){ data +=' data-telephone="' + store.te + '"'; } if(!that.isEmpty(store.mo)){ data +=' data-mobile="' + store.mo + '"'; } if(!that.isEmpty(store.fa)){ data +=' data-fax="' + store.fa + '"'; } if(!that.isEmpty(store.em)){ data +=' data-email="' + store.em + '"'; } if(!that.isEmpty(store.we)){ data +=' data-website="' + store.we + '"'; } html +=''; }} storeSelectField.html(html).trigger('change'); }, initEmbeddedSearch:function(){ var that=this; var addressField=$(this.settings.store_locator_address_field); var countryRestrict=this.settings.autocompleteCountryRestrict; var type=this.settings.autocompleteType; var map=this.map; if(!addressField){ return; } var autocompleteOptions={}; if(!that.isEmpty(countryRestrict)){ autocompleteOptions.componentRestrictions={'country':countryRestrict };} if(!that.isEmpty(type)){ autocompleteOptions.types=[type]; }else{ autocompleteOptions.types=['geocode']; } var autocomplete=new google.maps.places.Autocomplete(addressField[0], autocompleteOptions); autocomplete.addListener('place_changed', function(e){ var place=autocomplete.getPlace(); if(!that.isEmpty(place.formatted_address)){ addressField.val(place.formatted_address).trigger('focusout'); }else{ addressField.val(place.name).trigger('focusout'); }}); var store_locator_get_my_position=$(this.settings.store_locator_get_my_position); store_locator_get_my_position.on('click', function(e){ e.preventDefault(); if(navigator.geolocation){ var options={ enableHighAccuracy: true, timeout: 5000, maximumAge: 0 }; navigator.geolocation.getCurrentPosition(function(position){ if(addressField.val()===""){ var currentPosition=new google.maps.LatLng(position.coords.latitude, position.coords.longitude); that.currentPosition=currentPosition; that.lat=currentPosition.lat(); that.lng=currentPosition.lng(); that.geocodeLatLng(function(address){ addressField.val(address); }); }}, function(error){ console.log(error); }, options); }}).trigger('click'); }, isInfoWindowOpen:function(infoWindow){ var map=infoWindow.getMap(); return (map!==null&&typeof map!=="undefined"); }, buildReplaceState:function(){ var that=this; var address=$(that.settings.store_locator_address_field).val(); var categories=that.categories; var filter=that.filter; var radius=that.radius; var url=""; if(!that.isEmpty(address)){ url +='?location=' + address; } if(categories[0]){ if(url==""){ url +='?category=' + categories[0]; }else{ url +='&category=' + categories[0]; }} if(radius){ if(url==""){ url +='?radius=' + radius; }else{ url +='&radius=' + radius; }} if(filter){ var filterLoop=0; $.each(filter, function(i, index){ if(filterLoop==0&&url==""){ url +='?filter[]=' + index; }else{ url +='&filter[]=' + index; } filterLoop++; }); } window.history.replaceState('test', 'Store Locator', that.currentURL + url); }, isEmpty: function(obj){ if(obj==null) return true; if(obj.length > 0) return false; if(obj.length===0) return true; for (var key in obj){ if(hasOwnProperty.call(obj, key)) return false; } return true; }, sprintf: function parse(str){ var args=[].slice.call(arguments, 1), i=0; return str.replace(/%s/g, function(){ return args[i++]; }); }, getCookie: function(cname){ var name=cname + "="; var ca=document.cookie.split(';'); for(var i=0; i1e3?i=1e3:200>~~i&&(i=200),n.height=i),"link"===a.message)){if(o=t.createElement("a"),c=t.createElement("a"),o.href=n.getAttribute("src"),c.href=a.value,!u.test(c.protocol))continue;c.host===o.host&&t.activeElement===n&&(e.top.location.href=a.value)}}},r&&(e.addEventListener("message",e.wp.receiveEmbedMessage,!1),t.addEventListener("DOMContentLoaded",s,!1),e.addEventListener("load",s,!1)))}(window,document); function pabloguadi_sc_init_actions(){ "use strict"; setTimeout(function(){ pabloguadi_sc_animation(); }, 600); jQuery('body') .on('click', '.show_popup_menuitem', function(e){ "use strict"; pabloguadi_menuitems_show_popup(jQuery(this)); e.preventDefault(); return false; }) .on('click', '.close_menuitem, .popup_menuitem', function(e){ "use strict"; var target=jQuery(e.target); if(target.hasClass('popup_menuitem')||target.hasClass('close_menuitem')||target.parent().hasClass('close_menuitem')){ pabloguadi_menuitems_hide_popup(); e.preventDefault(); return false; }}); pabloguadi_sc_init(jQuery('body').eq(0)); } function pabloguadi_sc_resize_actions(){ "use strict"; pabloguadi_sc_sliders_resize(); pabloguadi_sc_equal_height(); } function pabloguadi_sc_scroll_actions(){ "use strict"; pabloguadi_sc_animation(); } function pabloguadi_sc_animation(){ jQuery('[data-animation^="animated"]:not(.animated)').each(function(){ "use strict"; if(jQuery(this).offset().top < jQuery(window).scrollTop() + jQuery(window).height()) jQuery(this).addClass(jQuery(this).data('animation')); }); } function pabloguadi_sc_init(container){ if(window.pabloguadi_theme_sc_init) pabloguadi_theme_sc_init(container); if(container.find('.sc_accordion:not(.inited)').length > 0){ container.find(".sc_accordion:not(.inited)").each(function (){ "use strict"; var init=jQuery(this).data('active'); if(isNaN(init)) init=0; else init=Math.max(0, init); jQuery(this) .addClass('inited') .accordion({ active: init, heightStyle: "content", header: "> .sc_accordion_item > .sc_accordion_title", create: function (event, ui){ "use strict"; pabloguadi_sc_init(ui.panel); if(window.pabloguadi_init_hidden_elements) pabloguadi_init_hidden_elements(ui.panel); ui.header.each(function (){ "use strict"; jQuery(this).parent().addClass('sc_active'); }); }, activate: function (event, ui){ "use strict"; pabloguadi_sc_init(ui.newPanel); if(window.pabloguadi_init_hidden_elements) pabloguadi_init_hidden_elements(ui.newPanel); ui.newHeader.each(function (){ "use strict"; jQuery(this).parent().addClass('sc_active'); }); ui.oldHeader.each(function (){ "use strict"; jQuery(this).parent().removeClass('sc_active'); }); }}); }); } if(container.find('.sc_blogger.layout_polaroid .photostack:not(.inited)').length > 0){ container.find(".sc_blogger.layout_polaroid .photostack:not(.inited)").each(function (){ "use strict"; var obj=jQuery(this); var id=obj.attr('id'); if(id==undefined){ id='photostack_'+Math.random(); id=id.replace('.', ''); obj.attr('id', id); } setTimeout(function(){ "use strict"; obj.addClass('inited').parent().height("auto"); new Photostack(obj.get(0), { callback: function(item){ }}); }, 10); }); } if(container.find('.sc_blogger .sc_scroll_horizontal .sc_scroll_wrapper:not(.inited)').length > 0){ container.find(".sc_blogger .sc_scroll_horizontal .sc_scroll_wrapper:not(.inited)").each(function (){ "use strict"; var obj=jQuery(this); var width=0; obj.find('.isotope_item').each(function(){ "use strict"; width +=jQuery(this).outerWidth(); }); obj.addClass('inited').width(width); }); } if(container.find('.sc_form form:not(.inited)').length > 0){ container.find(".sc_form form:not(.inited)").each(function(){ "use strict"; jQuery(this).addClass('inited'); jQuery(this).submit(function(e){ "use strict"; pabloguadi_sc_form_validate(jQuery(this)); e.preventDefault(); return false; }); if(jQuery(this).find('.js__datepicker').length > 0){ jQuery(this).find('.js__datepicker').pickadate({ onOpen: function(){ "use strict"; jQuery('pre').css('overflow', 'hidden'); }, onClose: function(){ "use strict"; jQuery('pre').css('overflow', ''); }, monthsShort: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec' ], showMonthsShort: true, format: 'dd.mm.yyyy', formatSubmit: 'yyyy-mm-dd', min: true }); } if(jQuery(this).find('.js__timepicker').length > 0){ jQuery(this).find('.js__timepicker').pickatime(); }}); } if(container.find('.sc_countdown:not(.inited)').length > 0){ container.find('.sc_countdown:not(.inited)') .each(function (){ "use strict"; jQuery(this).addClass('inited'); var id=jQuery(this).attr('id'); var curDate=new Date(); var curDateTimeStr=curDate.getFullYear()+'-'+(curDate.getMonth()<9 ? '0':'')+(curDate.getMonth()+1)+'-'+(curDate.getDate()<10 ? '0':'')+curDate.getDate() +' '+(curDate.getHours()<10 ? '0':'')+curDate.getHours()+':'+(curDate.getMinutes()<10 ? '0':'')+curDate.getMinutes()+':'+(curDate.getSeconds()<10 ? '0':'')+curDate.getSeconds(); var interval=1; var endDateStr=jQuery(this).data('date'); var endDateParts=endDateStr.split('-'); var endTimeStr=jQuery(this).data('time'); var endTimeParts=endTimeStr.split(':'); if(endTimeParts.length < 3) endTimeParts[2]='00'; var endDateTimeStr=endDateStr+' '+endTimeStr; if(curDateTimeStr < endDateTimeStr){ jQuery(this).find('.sc_countdown_placeholder').countdown({ until: new Date(endDateParts[0], endDateParts[1]-1, endDateParts[2], endTimeParts[0], endTimeParts[1], endTimeParts[2]), tickInterval: interval, onTick: pabloguadi_countdown }); }else{ jQuery(this).find('.sc_countdown_placeholder').countdown({ since: new Date(endDateParts[0], endDateParts[1]-1, endDateParts[2], endTimeParts[0], endTimeParts[1], endTimeParts[2]), tickInterval: interval, onTick: pabloguadi_countdown }); }}); } if(container.find('.sc_googlemap:not(.inited)').length > 0){ container.find('.sc_googlemap:not(.inited)') .each(function (){ "use strict"; if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return; var map=jQuery(this).addClass('inited'); var map_id=map.attr('id'); var map_zoom=map.data('zoom'); var map_style=map.data('style'); var map_markers=[]; map.find('.sc_googlemap_marker').each(function(){ "use strict"; var marker=jQuery(this); map_markers.push({ point: marker.data('point'), address: marker.data('address'), latlng: marker.data('latlng'), description: marker.data('description'), title: marker.data('title') }); }); pabloguadi_googlemap_init(jQuery('#'+map_id).get(0), {style: map_style, zoom: map_zoom, markers: map_markers}); }); } if(container.find('.sc_infobox.sc_infobox_closeable:not(.inited)').length > 0){ container.find('.sc_infobox.sc_infobox_closeable:not(.inited)') .addClass('inited') .on('click', function (e){ "use strict"; jQuery(this).slideUp(); e.preventDefault(); return false; }); } if(container.find('.sc_intro[data-href]:not(.inited)').length > 0){ container.find('.sc_intro[data-href]:not(.inited)') .addClass('inited') .on('click', function (e){ "use strict"; var link=jQuery(this).data('href'); window.location.href=link; e.preventDefault(); return false; }); } if(container.find('.sc_matches:not(.inited)').length > 0){ container.find('.sc_matches:not(.inited)') .each(function (){ "use strict"; jQuery(this).find('.sc_matches_next .sc_matches_list .sc_match').on('click', function (){ "use strict"; jQuery(this).parents('.sc_matches').find('.sc_matches_current .sc_match').hide(); var item=jQuery(this).data('item'); jQuery(item).fadeIn(); }); }); } if(container.find('.sc_players_table:not(.inited)').length > 0){ container.find('.sc_players_table:not(.inited)') .addClass('inited') .on('click', '.sort', function (e){ "use strict"; var table=jQuery(this).parents('.sc_players_table'); var id=jQuery(table).attr('id') var sort=jQuery(table).data('sort')=='asc' ? 'desc':'asc'; jQuery.post(PABLOGUADI_STORAGE['ajax_url'], { action: 'sort_by_points', nonce: PABLOGUADI_STORAGE['ajax_nonce'], sort: sort, table: PABLOGUADI_STORAGE['ajax_' + id] }).done(function(response){ var rez={}; try { rez=JSON.parse(response); } catch (e){ rez={ error: PABLOGUADI_STORAGE['ajax_error'] }; console.log(response); } if(rez.error===''){ table .data('sort', sort) .find('.sc_table') .after(rez.data) .remove(); pabloguadi_select_players_category(jQuery(table).find('.sc_players_table_category select')); }}); e.preventDefault(); return false; }); } if(container.find('.sc_players_table_category:not(.inited)').length > 0){ container.find('.sc_players_table_category:not(.inited)') .addClass('inited') .on('change', function (){ "use strict"; pabloguadi_select_players_category(jQuery(this)); }); } if(container.find('.sc_popup_link:not(.inited)').length > 0){ container.find('.sc_popup_link:not(.inited)').each(function(){ var popup_id=jQuery(this).attr('href'); jQuery(this) .addClass('inited') .magnificPopup({ type: 'inline', removalDelay: 500, midClick: true, callbacks: { beforeOpen: function (){ this.st.mainClass='mfp-zoom-in'; }, open: function(){ "use strict"; pabloguadi_sc_init(jQuery(popup_id)); pabloguadi_resize_actions(); if(window.pabloguadi_init_hidden_elements) pabloguadi_init_hidden_elements(jQuery(popup_id)); }, close: function(){}} }); }); } if(container.find('.sc_recent_news_header_category_item_more:not(.inited)').length > 0){ container.find('.sc_recent_news_header_category_item_more:not(.inited)').each(function(){ "use strict"; jQuery(this) .addClass('inited') .on('click', function(e){ "use strict"; jQuery(this).toggleClass('opened').find('.sc_recent_news_header_more_categories').slideToggle(); e.preventDefault(); return false; }); }); } if(container.find('.search_wrap:not(.inited)').length > 0){ container.find('.search_wrap:not(.inited)').each(function(){ "use strict"; jQuery(this) .addClass('inited') .on('click', '.search_submit', function(e){ "use strict"; var search_wrap=jQuery(this).parents('.search_wrap'); if(!search_wrap.hasClass('search_state_fixed')){ if(search_wrap.hasClass('search_state_opened')){ if(search_wrap.find('.search_field').val()!='') search_wrap.find('form').get(0).submit(); else search_wrap.removeClass('search_state_opened').addClass('search_state_closed').find('.search_results').fadeOut(); } else search_wrap.removeClass('search_state_closed').addClass('search_state_opened').find('.search_field').get(0).focus(); }else{ if(search_wrap.find('.search_field').val()!='') search_wrap.find('form').get(0).submit(); else { search_wrap.find('.search_field').val(''); search_wrap.find('.search_results').fadeOut(); }} e.preventDefault(); return false; }) .on('click', '.search_close', function(e){ "use strict"; jQuery(this).parents('.search_wrap').removeClass('search_state_opened').addClass('search_state_closed').find('.search_results').fadeOut(); e.preventDefault(); return false; }) .on('click', '.search_results_close', function(e){ "use strict"; jQuery(this).parent().fadeOut(); e.preventDefault(); return false; }) .on('click', '.search_more', function(e){ "use strict"; if(jQuery(this).parents('.search_wrap').find('.search_field').val()!='') jQuery(this).parents('.search_wrap').find('form').get(0).submit(); e.preventDefault(); return false; }) .on('blur', '.search_field', function(e){ if(jQuery(this).val()==''&&!jQuery(this).parents('.search_wrap').hasClass('search_state_fixed')) jQuery(this).parents('.search_wrap').removeClass('search_state_opened').addClass('search_state_closed').find('.search_results').fadeOut(); }); if(jQuery(this).hasClass('search_ajax')){ var ajax_timer=null; jQuery(this).find('.search_field').keyup(function(e){ "use strict"; var search_field=jQuery(this); var s=search_field.val(); if(ajax_timer){ clearTimeout(ajax_timer); ajax_timer=null; } if(s.length >=PABLOGUADI_STORAGE['ajax_search_min_length']){ ajax_timer=setTimeout(function(){ "use strict"; jQuery.post(PABLOGUADI_STORAGE['ajax_url'], { action: 'ajax_search', nonce: PABLOGUADI_STORAGE['ajax_nonce'], text: s }).done(function(response){ "use strict"; clearTimeout(ajax_timer); ajax_timer=null; var rez={}; try { rez=JSON.parse(response); } catch (e){ rez={ error: PABLOGUADI_STORAGE['ajax_error'] }; console.log(response); } if(rez.error===''){ search_field.parents('.search_ajax').find('.search_results_content').empty().append(rez.data); search_field.parents('.search_ajax').find('.search_results').fadeIn(); }else{ pabloguadi_message_warning(PABLOGUADI_STORAGE['strings']['search_error']); }}); }, PABLOGUADI_STORAGE['ajax_search_delay']); }}); }}); } if(container.find('.sc_pan:not(.inited_pan)').length > 0){ container.find('.sc_pan:not(.inited_pan)') .each(function (){ "use strict"; if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return; var pan=jQuery(this).addClass('inited_pan'); var cont=pan.parent(); cont.mousemove(function(e){ "use strict"; var anim={}; var tm=0; var pw=pan.width(), ph=pan.height(); var cw=cont.width(), ch=cont.height(); var coff=cont.offset(); if(pan.hasClass('sc_pan_vertical')) pan.css('top', -Math.floor((e.pageY - coff.top) / ch * (ph-ch))); if(pan.hasClass('sc_pan_horizontal')) pan.css('left', -Math.floor((e.pageX - coff.left) / cw * (pw-cw))); }); cont.mouseout(function(e){ "use strict"; pan.css({'left': 0, 'top': 0}); }); }); } if(container.find('.sc_scroll:not(.inited)').length > 0){ container.find('.sc_scroll:not(.inited)') .each(function (){ "use strict"; if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return; PABLOGUADI_STORAGE['scroll_init_counter']=0; pabloguadi_sc_init_scroll_area(jQuery(this)); }); } if(container.find('.sc_slider_swiper:not(.inited)').length > 0){ container.find('.sc_slider_swiper:not(.inited)') .each(function (){ "use strict"; if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return; jQuery(this).addClass('inited'); pabloguadi_sc_slider_autoheight(jQuery(this)); if(jQuery(this).parents('.sc_slider_pagination_area').length > 0){ jQuery(this).parents('.sc_slider_pagination_area').find('.sc_slider_pagination .post_item').eq(0).addClass('active'); } var id=jQuery(this).attr('id'); if(id==undefined){ id='swiper_'+Math.random(); id=id.replace('.', ''); jQuery(this).attr('id', id); } jQuery(this).addClass(id); jQuery(this).find('.slides .swiper-slide').css('position', 'relative'); var width=jQuery(this).width(); if(width==0) width=jQuery(this).parent().width(); var spv=jQuery(this).data('slides-per-view'); if(spv==undefined) spv=1; var min_width=jQuery(this).data('slides-min-width'); if(min_width==undefined) min_width=50; if(width / spv < min_width) spv=Math.max(1, Math.floor(width / min_width)); var space=jQuery(this).data('slides-space'); if(space==undefined) space=0; if(PABLOGUADI_STORAGE['swipers']===undefined) PABLOGUADI_STORAGE['swipers']={}; PABLOGUADI_STORAGE['swipers'][id]=new Swiper('.'+id, { calculateHeight: !jQuery(this).hasClass('sc_slider_height_fixed'), resizeReInit: true, autoResize: true, loop: true, grabCursor: true, nextButton: jQuery(this).hasClass('sc_slider_controls') ? '#'+id+' .sc_slider_next':false, prevButton: jQuery(this).hasClass('sc_slider_controls') ? '#'+id+' .sc_slider_prev':false, pagination: jQuery(this).hasClass('sc_slider_pagination') ? '#'+id+' .sc_slider_pagination_wrap':false, paginationClickable: true, autoplay: jQuery(this).hasClass('sc_slider_noautoplay') ? false:(isNaN(jQuery(this).data('interval')) ? 7000:jQuery(this).data('interval')), autoplayDisableOnInteraction: false, initialSlide: 0, slidesPerView: spv, loopedSlides: spv, spaceBetween: space, speed: 600, onFirstInit: function (slider){ "use strict"; var cont=jQuery(slider.container); if(!cont.hasClass('sc_slider_height_auto')) return; var li=cont.find('.swiper-slide').eq(1); var h=li.data('height_auto'); if(h > 0){ var pt=parseInt(li.css('paddingTop')), pb=parseInt(li.css('paddingBottom')); li.height(h); cont.height(h + (isNaN(pt) ? 0:pt) + (isNaN(pb) ? 0:pb)); cont.find('.swiper-wrapper').height(h + (isNaN(pt) ? 0:pt) + (isNaN(pb) ? 0:pb)); }}, onSlideChangeStart: function (slider){ "use strict"; var cont=jQuery(slider.container); if(!cont.hasClass('sc_slider_height_auto')) return; var idx=slider.activeIndex; var li=cont.find('.swiper-slide').eq(idx); var h=li.data('height_auto'); if(h > 0){ var pt=parseInt(li.css('paddingTop')), pb=parseInt(li.css('paddingBottom')); li.height(h); cont.height(h + (isNaN(pt) ? 0:pt) + (isNaN(pb) ? 0:pb)); cont.find('.swiper-wrapper').height(h + (isNaN(pt) ? 0:pt) + (isNaN(pb) ? 0:pb)); }}, onSlideChangeEnd: function (slider, dir){ "use strict"; var cont=jQuery(slider.container); if(cont.parents('.sc_slider_pagination_area').length > 0){ var li=cont.parents('.sc_slider_pagination_area').find('.sc_slider_pagination .post_item'); var idx=slider.activeIndex > li.length ? 0:slider.activeIndex-1; pabloguadi_sc_change_active_pagination_in_slider(cont, idx); }} }); jQuery(this).data('settings', {mode: 'horizontal'}); var curSlide=jQuery(this).find('.slides').data('current-slide'); if(curSlide > 0) PABLOGUADI_STORAGE['swipers'][id].slideTo(curSlide-1); pabloguadi_sc_prepare_slider_navi(jQuery(this)); }); pabloguadi_sc_sliders_resize(); } if(container.find('.sc_skills_item:not(.inited)').length > 0){ pabloguadi_sc_init_skills(container); jQuery(window).scroll(function (){ pabloguadi_sc_init_skills(container); }); } if(container.find('.sc_skills_arc:not(.inited)').length > 0){ pabloguadi_sc_init_skills_arc(container); jQuery(window).scroll(function (){ pabloguadi_sc_init_skills_arc(container); }); } if(container.find('.sc_tabs:not(.inited):not(.no_jquery_ui),.tabs_area:not(.inited)').length > 0){ container.find('.sc_tabs:not(.inited):not(.no_jquery_ui),.tabs_area:not(.inited)').each(function (){ "use strict"; var init=jQuery(this).data('active'); if(isNaN(init)) init=0; else init=Math.max(0, init); jQuery(this) .addClass('inited') .tabs({ active: init, show: { effect: 'fadeIn', duration: 300 }, hide: { effect: 'fadeOut', duration: 300 }, create: function (event, ui){ "use strict"; pabloguadi_sc_init(ui.panel); if(window.pabloguadi_init_hidden_elements) pabloguadi_init_hidden_elements(ui.panel); pabloguadi_init_isotope(); }, activate: function (event, ui){ "use strict"; pabloguadi_sc_init(ui.newPanel); if(window.pabloguadi_init_hidden_elements) pabloguadi_init_hidden_elements(ui.newPanel); pabloguadi_init_isotope(); }}); }); } if(container.find('.sc_tabs.no_jquery_ui:not(.inited)').length > 0){ container.find('.sc_tabs.no_jquery_ui:not(.inited)').each(function (){ "use strict"; jQuery(this) .addClass('inited') .on('click', '.sc_tabs_titles li a', function(e){ "use strict"; if(!jQuery(this).parent().hasClass('sc_tabs_active')){ var id_act=jQuery(this).parent().siblings('.sc_tabs_active').find('a').attr('href'); var id=jQuery(this).attr('href'); jQuery(this).parent().addClass('sc_tabs_active').siblings().removeClass('sc_tabs_active'); jQuery(id_act).fadeOut(function(){ "use strict"; jQuery(id).fadeIn(function(){ "use strict"; pabloguadi_sc_init(jQuery(this)); if(window.pabloguadi_init_hidden_elements) pabloguadi_init_hidden_elements(jQuery(this)); }); }); } e.preventDefault(); return false; }); jQuery(this).find('.sc_tabs_titles li').eq(0).addClass('sc_tabs_active'); jQuery(this).find('.sc_tabs_content').eq(0).fadeIn(function(){ "use strict"; pabloguadi_sc_init(jQuery(this)); if(window.pabloguadi_init_hidden_elements) pabloguadi_init_hidden_elements(jQuery(this)); }); }); } if(container.find('.sc_toggles .sc_toggles_title:not(.inited)').length > 0){ container.find('.sc_toggles .sc_toggles_title:not(.inited)') .addClass('inited') .on('click', function (){ "use strict"; jQuery(this).toggleClass('ui-state-active').parent().toggleClass('sc_active'); jQuery(this).parent().find('.sc_toggles_content').slideToggle(300, function (){ "use strict"; pabloguadi_sc_init(jQuery(this).parent().find('.sc_toggles_content')); if(window.pabloguadi_init_hidden_elements) pabloguadi_init_hidden_elements(jQuery(this).parent().find('.sc_toggles_content')); }); }); } if(container.find('.sc_zoom:not(.inited)').length > 0){ container.find('.sc_zoom:not(.inited)') .each(function (){ "use strict"; if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return; jQuery(this).addClass('inited'); jQuery(this).find('img').elevateZoom({ zoomType: "lens", lensShape: "round", lensSize: 200, lensBorderSize: 4, lensBorderColour: '#ccc' }); }); }} function pabloguadi_sc_init_scroll_area(obj){ "use strict"; if(!pabloguadi_check_images_complete(obj)&&PABLOGUADI_STORAGE['scroll_init_counter']++ < 30){ setTimeout(function(){ pabloguadi_sc_init_scroll_area(obj); }, 200); return; } obj.addClass('inited'); var id=obj.attr('id'); if(id==undefined){ id='scroll_'+Math.random(); id=id.replace('.', ''); obj.attr('id', id); } obj.addClass(id); var parent_obj=obj.parent(); var parent_id=parent_obj.attr('id'); if(parent_id==undefined){ parent_id='scroll_wrap_'+Math.random(); parent_id=parent_id.replace('.', ''); parent_obj.attr('id', parent_id); } parent_obj.addClass(parent_id); var bar=obj.find('#'+id+'_bar'); if(bar.length > 0&&!bar.hasClass(id+'_bar')){ bar.addClass(id+'_bar'); } if(obj.hasClass('sc_scroll_horizontal')){ obj.find('.sc_scroll_wrapper > .sc_scroll_slide').css('width', 'auto'); obj.find('.sc_scroll_wrapper').css('width', obj.find('.sc_scroll_wrapper > .sc_scroll_slide').width()+10); obj.find('.sc_scroll_wrapper > .sc_scroll_slide').css('width', '100%') } if(PABLOGUADI_STORAGE['swipers']===undefined) PABLOGUADI_STORAGE['swipers']={}; PABLOGUADI_STORAGE['swipers'][id]=new Swiper('.'+id, { calculateHeight: false, resizeReInit: true, autoResize: true, freeMode: true, freeModeFluid: true, grabCursor: true, mode: obj.hasClass('sc_scroll_vertical') ? 'vertical':'horizontal', direction: obj.hasClass('sc_scroll_vertical') ? 'vertical':'horizontal', slidesPerView: obj.hasClass('sc_scroll') ? 'auto':1, nextButton: parent_obj.hasClass('sc_scroll_controls') ? '#'+parent_id+' .sc_scroll_next':false, prevButton: parent_obj.hasClass('sc_scroll_controls') ? '#'+parent_id+' .sc_scroll_prev':false, scrollbar: '.'+id+'_bar', scrollbarHide: true, }) obj.data('settings', {mode: 'horizontal'}); } function pabloguadi_sc_prepare_slider_navi(slider){ "use strict"; var navi=null; if(false){ navi=slider.find('> .sc_slider_controls_wrap, > .sc_scroll_controls_wrap'); if(navi.length==0) navi=slider.siblings('.sc_slider_controls_wrap,.sc_scroll_controls_wrap'); if(navi.length > 0){ navi.on('click', '.sc_slider_prev,.sc_scroll_prev', function(e){ var swiper=jQuery(this).parents('.swiper-slider-container'); if(swiper.length==0) swiper=jQuery(this).parents('.sc_slider_controls_wrap,.sc_scroll_controls_wrap').siblings('.swiper-slider-container'); var id=swiper.attr('id'); PABLOGUADI_STORAGE['swipers'][id].slidePrev(); e.preventDefault(); return false; }) .on('click', '.sc_slider_next,.sc_scroll_next', function(e){ var swiper=jQuery(this).parents('.swiper-slider-container'); if(swiper.length==0) swiper=jQuery(this).parents('.sc_slider_controls_wrap,.sc_scroll_controls_wrap').siblings('.swiper-slider-container'); var id=swiper.attr('id'); PABLOGUADI_STORAGE['swipers'][id].slideNext(); e.preventDefault(); return false; }); }} navi=slider.siblings('.sc_slider_pagination'); if(navi.length > 0){ navi.on('click', '.post_item', function(e){ var swiper=jQuery(this).parents('.sc_slider_pagination_area').find('.swiper-slider-container'); var id=swiper.attr('id'); PABLOGUADI_STORAGE['swipers'][id].slideTo(jQuery(this).index()+1); e.preventDefault(); return false; }); }} function pabloguadi_sc_change_active_pagination_in_slider(slider, idx){ "use strict"; var pg=slider.parents('.sc_slider_pagination_area').find('.sc_slider_pagination'); if(pg.length==0) return; pg.find('.post_item').removeClass('active').eq(idx).addClass('active'); var h=pg.height(); var off=pg.find('.active').offset().top - pg.offset().top; var off2=pg.find('.sc_scroll_wrapper').offset().top - pg.offset().top; var h2=pg.find('.active').height(); if(off < 0){ pg.find('.sc_scroll_wrapper').css({'transform': 'translate3d(0px, 0px, 0px)', 'transition-duration': '0.3s'}); }else if(h <=off+h2){ pg.find('.sc_scroll_wrapper').css({'transform': 'translate3d(0px, -'+(Math.abs(off2)+off-h/4)+'px, 0px)', 'transition-duration': '0.3s'}); }} function pabloguadi_sc_slider_autoheight(slider){ "use strict"; if(slider.hasClass('.sc_slider_height_auto')){ slider.find('.swiper-slide').each(function(){ "use strict"; if(jQuery(this).data('height_auto')==undefined){ jQuery(this).attr('data-height_auto', jQuery(this).height()); }}); }} function pabloguadi_sc_sliders_resize(){ "use strict"; var slider=arguments[0]!==undefined ? arguments[0]:'.sc_slider_swiper.inited'; var resize=arguments[1]!==undefined ? arguments[1]:true; jQuery(slider).each(function(){ "use strict"; var id=jQuery(this).attr('id'); var width=jQuery(this).width(); var last_width=jQuery(this).data('last-width'); if(isNaN(last_width)) last_width=0; if(last_width==0||last_width!=width){ var spv=jQuery(this).data('slides-per-view'); if(spv==undefined) spv=1; var min_width=jQuery(this).data('slides-min-width'); if(min_width==undefined) min_width=50; if(width / spv < min_width) spv=Math.max(1, Math.floor(width / min_width)); jQuery(this).data('last-width', width); if(PABLOGUADI_STORAGE['swipers'][id].params.slidesPerView!=spv){ PABLOGUADI_STORAGE['swipers'][id].params.slidesPerView=spv; PABLOGUADI_STORAGE['swipers'][id].params.loopedSlides=spv; } PABLOGUADI_STORAGE['swipers'][id].onResize(); } if(resize&&!jQuery(this).hasClass('sc_slider_height_fixed')){ var h=0; if(jQuery(this).find('.swiper-slide > img').length > 0){ jQuery(this).find('.swiper-slide > img').each(function(){ "use strict"; if(jQuery(this).height() > h) h=jQuery(this).height(); }); jQuery(this).height(h); }else if(jQuery(this).find('.swiper-slide').css('backgroundImage')!='none'){ h=Math.floor(width/16*9); jQuery(this).height(h).find('.swiper-slide').height(h); }} }); jQuery('.sc_slider_pagination_area').each(function(){ "use strict"; var h=jQuery(this).find('.sc_slider').height(); if(h){ jQuery(this).height(h); jQuery(this).find('.sc_slider_pagination').height(h); jQuery(this).find('.sc_slider_pagination .sc_scroll_vertical').height(h); }}); } function pabloguadi_sc_equal_height(){ "use strict"; jQuery('[data-equal-height]').each(function(){ "use strict"; var eh_wrap=jQuery(this); var eh_items_selector=eh_wrap.data('equal-height'); if(eh_items_selector){ var max_h=0; var items=[]; var row_y=0; var i=0; eh_wrap.find(eh_items_selector).each(function(){ "use strict"; var el=jQuery(this); el.height('auto'); var el_height=el.height(); var el_offset=el.offset().top; if(row_y==0) row_y=el_offset; if(row_y < el_offset){ if(items.length > 0){ if(max_h > 0){ for (i=0; i max_h) max_h=el_height; items.push(el); }); if(items.length > 0&&max_h > 0){ for (i=0; i scrollSkills){ skillsItem.addClass('inited'); var skills=skillsItem.parents('.sc_skills').eq(0); var type=skills.data('type'); var total=(type=='pie'&&skills.hasClass('sc_skills_compact_on')) ? skillsItem.find('.sc_skills_data .pie'):skillsItem.find('.sc_skills_total').eq(0); var start=parseInt(total.data('start')); var stop=parseInt(total.data('stop')); var maximum=parseInt(total.data('max')); var startPercent=Math.round(start/maximum*100); var stopPercent=Math.round(stop/maximum*100); var ed=total.data('ed'); var duration=parseInt(total.data('duration')); var speed=parseInt(total.data('speed')); var step=parseInt(total.data('step')); if(type=='bar'){ var dir=skills.data('dir'); var count=skillsItem.find('.sc_skills_count').eq(0); if(dir=='horizontal') count.css('width', startPercent + '%').animate({ width: stopPercent + '%' }, duration); else if(dir=='vertical') count.css('height', startPercent + '%').animate({ height: stopPercent + '%' }, duration); pabloguadi_sc_animate_skills_counter(start, stop, speed-(dir!='unknown' ? 5:0), step, ed, total); }else if(type=='counter'){ pabloguadi_sc_animate_skills_counter(start, stop, speed - 5, step, ed, total); }else if(type=='pie'){ var steps=parseInt(total.data('steps')); var bg_color=total.data('bg_color'); var border_color=total.data('border_color'); var cutout=parseInt(total.data('cutout')); var easing=total.data('easing'); var options={ segmentShowStroke: false, segmentStrokeColor: border_color, segmentStrokeWidth: 1, percentageInnerCutout:cutout, animationSteps: steps, animationEasing: easing, animateRotate: true, animateScale: false, }; var pieData=[]; total.each(function(){ "use strict"; var color=jQuery(this).data('color'); var stop=parseInt(jQuery(this).data('stop')); var stopPercent=Math.round(stop/maximum*100); pieData.push({ value: stopPercent, color: color }); }); if(total.length==1){ pabloguadi_sc_animate_skills_counter(start, stop, Math.round(1500/steps), step, ed, total); pieData.push({ value: 100-stopPercent, color: bg_color }); } var canvas=skillsItem.find('canvas'); canvas.attr({width: skillsItem.width(), height: skillsItem.width()}).css({width: skillsItem.width(), height: skillsItem.height()}); new Chart(canvas.get(0).getContext("2d")).Doughnut(pieData, options); }} }); } function pabloguadi_sc_animate_skills_counter(start, stop, speed, step, ed, total){ "use strict"; start=Math.min(stop, start + step); total.text(start+ed); if(start < stop){ setTimeout(function (){ pabloguadi_sc_animate_skills_counter(start, stop, speed, step, ed, total); }, speed); }} function pabloguadi_sc_init_skills_arc(container){ "use strict"; if(arguments.length==0) var container=jQuery('body'); container.find('.sc_skills_arc:not(.inited)').each(function (){ var arc=jQuery(this); arc.addClass('inited'); var items=arc.find('.sc_skills_data .arc'); var canvas=arc.find('.sc_skills_arc_canvas').eq(0); var legend=arc.find('.sc_skills_legend').eq(0); var w=Math.round(arc.width() - legend.width()); var c=Math.floor(w/2); var o={ random: function(l, u){ "use strict"; return Math.floor((Math.random()*(u-l+1))+l); }, diagram: function(){ "use strict"; var r=Raphael(canvas.attr('id'), w, w), hover=Math.round(w/2/items.length), rad=hover, step=Math.round(((w-20)/2-rad)/items.length), stroke=Math.round(w/9/items.length), speed=400; r.circle(c, c, Math.round(w/2)).attr({ stroke: 'none', fill: PABLOGUADI_STORAGE['theme_bg_color'] ? PABLOGUADI_STORAGE['theme_bg_color']:'#ffffff' }); var title=r.text(c, c, arc.data('caption')).attr({ font: Math.round(rad*0.75)+'px "'+PABLOGUADI_STORAGE['theme_font']+'"', fill: PABLOGUADI_STORAGE['theme_color'] ? PABLOGUADI_STORAGE['theme_color']:'#909090' }).toFront(); rad -=Math.round(step/2); r.customAttributes.arc=function(value, color, rad){ "use strict"; var v=3.6 * value, alpha=v==360 ? 359.99:v, rand=o.random(91, 240), a=(rand-alpha) * Math.PI/180, b=rand * Math.PI/180, sx=c + rad * Math.cos(b), sy=c - rad * Math.sin(b), x=c + rad * Math.cos(a), y=c - rad * Math.sin(a), path=[['M', sx, sy], ['A', rad, rad, 0, +(alpha > 180), 1, x, y]]; return { path: path, stroke: color }} items.each(function(i){ "use strict"; var t=jQuery(this), color=t.find('.color').val(), value=t.find('.percent').val(), text=t.find('.text').text(); rad +=step; var z=r.path().attr({ arc: [value, color, rad], 'stroke-width': stroke }); z.mouseover(function(){ "use strict"; this.animate({ 'stroke-width': hover, opacity: .75 }, 1000, 'elastic'); if(Raphael.type!='VML') this.toFront(); title.stop().animate({ opacity: 0 }, speed, '>', function(){ this.attr({ text: (text ? text + '\n':'') + value + '%' }).animate({ opacity: 1 }, speed, '<'); }); }).mouseout(function(){ "use strict"; this.stop().animate({ 'stroke-width': stroke, opacity: 1 }, speed*4, 'elastic'); title.stop().animate({ opacity: 0 }, speed, '>', function(){ title.attr({ text: arc.data('caption') }).animate({ opacity: 1 }, speed, '<'); }); }); }); }} o.diagram(); }); } function pabloguadi_countdown(dt){ "use strict"; var counter=jQuery(this).parent(); for (var i=3; i=0; ch--){ counter.find('.sc_countdown_item').eq(i-3).find('.sc_countdown_digits span').eq(ch+(i==3&&v.length<3 ? 1:0)).removeClass('hide').text(v.substr(ch, 1)); }} } function pabloguadi_sc_form_validate(form){ "use strict"; var url=form.attr('action'); if(url=='') return false; form.find('input').removeClass('error_fields_class'); var error=false; var form_custom=form.data('formtype')=='form_custom'; if(!form_custom){ var rules=[], rule={}; if(form.find('[name="username"]').length > 0){ rule={ field: "username", max_length: { value: 60, message: PABLOGUADI_STORAGE['strings']['name_long'] }}; if(form.find('[name="username"][aria-required="true"]').length > 0) rule['min_length']={ value: 1, message: PABLOGUADI_STORAGE['strings']['name_empty'] }; rules.push(rule); } if(form.find('[name="email"]').length > 0){ rule={ field: "email", max_length: { value: 60, message: PABLOGUADI_STORAGE['strings']['email_long'] }, mask: { value: PABLOGUADI_STORAGE['email_mask'], message: PABLOGUADI_STORAGE['strings']['email_not_valid'] }}; if(form.find('[name="email"][aria-required="true"]').length > 0) rule['min_length']={ value: 7, message: PABLOGUADI_STORAGE['strings']['email_empty'] }; rules.push(rule); } if(form.find('[name="subject"]').length > 0){ rule={ field: "subject", max_length: { value: 100, message: PABLOGUADI_STORAGE['strings']['subject_long'] }}; if(form.find('[name="subject"][aria-required="true"]').length > 0) rule['min_length']={ value: 1, message: PABLOGUADI_STORAGE['strings']['subject_empty'] }; rules.push(rule); } if(form.find('[name="message"]').length > 0){ rule={ field: "message", max_length: { value: PABLOGUADI_STORAGE['contacts_maxlength'], message: PABLOGUADI_STORAGE['strings']['text_long'] }}; if(form.find('[name="message"][aria-required="true"]').length > 0) rule['min_length']={ value: 1, message: PABLOGUADI_STORAGE['strings']['text_empty'] }; rules.push(rule); } error=pabloguadi_form_validate(form, { error_message_show: true, error_message_time: 4000, error_message_class: "sc_infobox sc_infobox_style_error", error_fields_class: "error_fields_class", exit_after_first_error: false, rules: rules }); } if(!error&&url!='#'){ jQuery.post(url, { action: "send_form", nonce: PABLOGUADI_STORAGE['ajax_nonce'], type: form.data('formtype'), data: form.serialize() }).done(function(response){ "use strict"; var rez={}; try { rez=JSON.parse(response); } catch (e){ rez={ error: PABLOGUADI_STORAGE['ajax_error'] }; console.log(response); } var result=form.find(".result").toggleClass("sc_infobox_style_error", false).toggleClass("sc_infobox_style_success", false); if(rez.error===''){ form.get(0).reset(); result.addClass("sc_infobox_style_success").html(PABLOGUADI_STORAGE['strings']['send_complete']); var return_url=form.find('input[name="return_url"]'); if(return_url.length > 0&&return_url.val()!=''){ setTimeout(function(){ "use strict"; window.location.href=return_url.val(); }, 3300); }}else{ result.addClass("sc_infobox_style_error").html(PABLOGUADI_STORAGE['strings']['send_error'] + ' ' + rez.error); } result.fadeIn().delay(3000).fadeOut(); }); } return !error; } function pabloguadi_select_players_category(sel){ var value=sel.find(':selected').data('cat'); var table=sel.parents('.sc_players_table'); if(value=='all') jQuery(table).find('.sc_table tr:nth-child(n+2)').show(); else { jQuery(table).find('.sc_table tr:nth-child(n+2)').hide(); jQuery(table).find('.sc_table tr').each(function(){ var cat=jQuery(this).data('cat'); if(cat!=null&&cat.indexOf(value)!=-1) jQuery(this).show(); }); }} function pabloguadi_menuitems_show_popup(obj){ "use strict"; if(typeof PABLOGUADI_STORAGE['menuitem_load']=='undefined'){ PABLOGUADI_STORAGE['menuitem_load']=false; PABLOGUADI_STORAGE['menuitems_list']=[]; }else if(PABLOGUADI_STORAGE['menuitem_load']){ return; } jQuery('#page_preloader').data('bg-color', jQuery('#page_preloader').css('background-color')).css({display: 'block', opacity: 0, backgroundColor: 'transparent'}).animate({opacity:0.8}, 300); if(PABLOGUADI_STORAGE['menuitems_list'].length==0){ var menuitems_list_id=obj.parents('.sc_menuitems').attr("id"); PABLOGUADI_STORAGE['menuitems_list']=PABLOGUADI_STORAGE['menuitems'][menuitems_list_id].split(","); } var menuitem_id=obj.attr('rel'); PABLOGUADI_STORAGE['menuitem_load']=true; jQuery.post(PABLOGUADI_STORAGE['ajax_url'], { action: 'ajax_menuitem', nonce: PABLOGUADI_STORAGE['ajax_nonce'], text: menuitem_id }).done(function(response){ "use strict"; PABLOGUADI_STORAGE['menuitem_load']=false; var rez={}; try { rez=JSON.parse(response); } catch (e){ rez={ error: PABLOGUADI_STORAGE['ajax_error'] + '
' + response };} jQuery('#page_preloader').animate({opacity:0}, 500, function(){ jQuery(this).css({display: 'none', backgroundColor: jQuery(this).data('bg-color')});}); if(rez.error===''){ var delay=0; if(jQuery('.popup_menuitem').length==0){ jQuery('body').append('
'); jQuery('#overlay').fadeIn(500); }else{ delay=500; jQuery('.popup_menuitem').fadeOut(delay); } setTimeout(function(){ jQuery('.popup_menuitem').html(rez.data); jQuery('.popup_menuitem .sc_menuitems_wrap').append(""); if(PABLOGUADI_STORAGE['menuitems_list'].length > 1){ var idx=0; for (var i=0; i" + "" ); } jQuery('.popup_menuitem').fadeIn(500); }, delay); }else{ pabloguadi_message_warning(PABLOGUADI_STORAGE['strings']['search_error']); }}); } function pabloguadi_menuitems_hide_popup(){ "use strict"; jQuery('#overlay').fadeOut(); jQuery('.popup_menuitem').fadeOut(function(){ PABLOGUADI_STORAGE['menuitem_load']=false; PABLOGUADI_STORAGE['menuitems_list']=[]; jQuery('#overlay').remove(); jQuery(this).remove(); }); }; (function(t){function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))})}function n(e,i){t.fn[e]=function(n){if("string"==typeof n){for(var s=o.call(arguments,1),a=0,u=this.length;u>a;a++){var p=this[a],h=t.data(p,e);if(h)if(t.isFunction(h[n])&&"_"!==n.charAt(0)){var f=h[n].apply(h,s);if(void 0!==f)return f}else r("no such method '"+n+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; "+"attempted to call '"+n+"'")}return this}return this.each(function(){var o=t.data(this,e);o?(o.option(n),o._init()):(o=new i(this,n),t.data(this,e,o))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};return t.bridget=function(t,e){i(e),n(t,e)},t.bridget}}var o=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],i):i(t.jQuery)})(window),function(t){function e(e){var i=t.event;return i.target=i.target||i.srcElement||e,i}var i=document.documentElement,o=function(){};i.addEventListener?o=function(t,e,i){t.addEventListener(e,i,!1)}:i.attachEvent&&(o=function(t,i,o){t[i+o]=o.handleEvent?function(){var i=e(t);o.handleEvent.call(o,i)}:function(){var i=e(t);o.call(t,i)},t.attachEvent("on"+i,t[i+o])});var n=function(){};i.removeEventListener?n=function(t,e,i){t.removeEventListener(e,i,!1)}:i.detachEvent&&(n=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(o){t[e+i]=void 0}});var r={bind:o,unbind:n};"function"==typeof define&&define.amd?define("eventie/eventie",r):"object"==typeof exports?module.exports=r:t.eventie=r}(this),function(t){function e(t){"function"==typeof t&&(e.isReady?t():r.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==n.readyState;if(!e.isReady&&!i){e.isReady=!0;for(var o=0,s=r.length;s>o;o++){var a=r[o];a()}}}function o(o){return o.bind(n,"DOMContentLoaded",i),o.bind(n,"readystatechange",i),o.bind(t,"load",i),e}var n=t.document,r=[];e.isReady=!1,"function"==typeof define&&define.amd?(e.isReady="function"==typeof requirejs,define("doc-ready/doc-ready",["eventie/eventie"],o)):t.docReady=o(t.eventie)}(this),function(){function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var o=t.prototype,n=this,r=n.EventEmitter;o.getListeners=function(t){var e,i,o=this._getEvents();if(t instanceof RegExp){e={};for(i in o)o.hasOwnProperty(i)&&t.test(i)&&(e[i]=o[i])}else e=o[t]||(o[t]=[]);return e},o.flattenListeners=function(t){var e,i=[];for(e=0;t.length>e;e+=1)i.push(t[e].listener);return i},o.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},o.addListener=function(t,i){var o,n=this.getListenersAsObject(t),r="object"==typeof i;for(o in n)n.hasOwnProperty(o)&&-1===e(n[o],i)&&n[o].push(r?i:{listener:i,once:!1});return this},o.on=i("addListener"),o.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},o.once=i("addOnceListener"),o.defineEvent=function(t){return this.getListeners(t),this},o.defineEvents=function(t){for(var e=0;t.length>e;e+=1)this.defineEvent(t[e]);return this},o.removeListener=function(t,i){var o,n,r=this.getListenersAsObject(t);for(n in r)r.hasOwnProperty(n)&&(o=e(r[n],i),-1!==o&&r[n].splice(o,1));return this},o.off=i("removeListener"),o.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},o.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},o.manipulateListeners=function(t,e,i){var o,n,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(o=i.length;o--;)r.call(this,e,i[o]);else for(o in e)e.hasOwnProperty(o)&&(n=e[o])&&("function"==typeof n?r.call(this,o,n):s.call(this,o,n));return this},o.removeEvent=function(t){var e,i=typeof t,o=this._getEvents();if("string"===i)delete o[t];else if(t instanceof RegExp)for(e in o)o.hasOwnProperty(e)&&t.test(e)&&delete o[e];else delete this._events;return this},o.removeAllListeners=i("removeEvent"),o.emitEvent=function(t,e){var i,o,n,r,s=this.getListenersAsObject(t);for(n in s)if(s.hasOwnProperty(n))for(o=s[n].length;o--;)i=s[n][o],i.once===!0&&this.removeListener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},o.trigger=i("emitEvent"),o.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},o.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},o._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},o._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return n.EventEmitter=r,t},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):"object"==typeof module&&module.exports?module.exports=t:this.EventEmitter=t}.call(this),function(t){function e(t){if(t){if("string"==typeof o[t])return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e,n=0,r=i.length;r>n;n++)if(e=i[n]+t,"string"==typeof o[e])return e}}var i="Webkit Moz ms Ms O".split(" "),o=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return e}):"object"==typeof exports?module.exports=e:t.getStyleProperty=e}(window),function(t){function e(t){var e=parseFloat(t),i=-1===t.indexOf("%")&&!isNaN(e);return i&&e}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,i=s.length;i>e;e++){var o=s[e];t[o]=0}return t}function o(t){function o(t){if("string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var o=r(t);if("none"===o.display)return i();var n={};n.width=t.offsetWidth,n.height=t.offsetHeight;for(var h=n.isBorderBox=!(!p||!o[p]||"border-box"!==o[p]),f=0,c=s.length;c>f;f++){var d=s[f],l=o[d];l=a(t,l);var y=parseFloat(l);n[d]=isNaN(y)?0:y}var m=n.paddingLeft+n.paddingRight,g=n.paddingTop+n.paddingBottom,v=n.marginLeft+n.marginRight,_=n.marginTop+n.marginBottom,I=n.borderLeftWidth+n.borderRightWidth,L=n.borderTopWidth+n.borderBottomWidth,z=h&&u,S=e(o.width);S!==!1&&(n.width=S+(z?0:m+I));var b=e(o.height);return b!==!1&&(n.height=b+(z?0:g+L)),n.innerWidth=n.width-(m+I),n.innerHeight=n.height-(g+L),n.outerWidth=n.width+v,n.outerHeight=n.height+_,n}}function a(t,e){if(n||-1===e.indexOf("%"))return e;var i=t.style,o=i.left,r=t.runtimeStyle,s=r&&r.left;return s&&(r.left=t.currentStyle.left),i.left=e,e=i.pixelLeft,i.left=o,s&&(r.left=s),e}var u,p=t("boxSizing");return function(){if(p){var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style[p]="border-box";var i=document.body||document.documentElement;i.appendChild(t);var o=r(t);u=200===e(o.width),i.removeChild(t)}}(),o}var n=t.getComputedStyle,r=n?function(t){return n(t,null)}:function(t){return t.currentStyle},s=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],o):"object"==typeof exports?module.exports=o(require("get-style-property")):t.getSize=o(t.getStyleProperty)}(window),function(t,e){function i(t,e){return t[a](e)}function o(t){if(!t.parentNode){var e=document.createDocumentFragment();e.appendChild(t)}}function n(t,e){o(t);for(var i=t.parentNode.querySelectorAll(e),n=0,r=i.length;r>n;n++)if(i[n]===t)return!0;return!1}function r(t,e){return o(t),i(t,e)}var s,a=function(){if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],i=0,o=t.length;o>i;i++){var n=t[i],r=n+"MatchesSelector";if(e[r])return r}}();if(a){var u=document.createElement("div"),p=i(u,"div");s=p?i:r}else s=n;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return s}):window.matchesSelector=s}(this,Element.prototype),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){for(var e in t)return!1;return e=null,!0}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}function n(t,n,r){function a(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var u=r("transition"),p=r("transform"),h=u&&p,f=!!r("perspective"),c={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[u],d=["transform","transition","transitionDuration","transitionProperty"],l=function(){for(var t={},e=0,i=d.length;i>e;e++){var o=d[e],n=r(o);n&&n!==o&&(t[o]=n)}return t}();e(a.prototype,t.prototype),a.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},a.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},a.prototype.getSize=function(){this.size=n(this.element)},a.prototype.css=function(t){var e=this.element.style;for(var i in t){var o=l[i]||i;e[o]=t[i]}},a.prototype.getPosition=function(){var t=s(this.element),e=this.layout.options,i=e.isOriginLeft,o=e.isOriginTop,n=parseInt(t[i?"left":"right"],10),r=parseInt(t[o?"top":"bottom"],10);n=isNaN(n)?0:n,r=isNaN(r)?0:r;var a=this.layout.size;n-=i?a.paddingLeft:a.paddingRight,r-=o?a.paddingTop:a.paddingBottom,this.position.x=n,this.position.y=r},a.prototype.layoutPosition=function(){var t=this.layout.size,e=this.layout.options,i={};e.isOriginLeft?(i.left=this.position.x+t.paddingLeft+"px",i.right=""):(i.right=this.position.x+t.paddingRight+"px",i.left=""),e.isOriginTop?(i.top=this.position.y+t.paddingTop+"px",i.bottom=""):(i.bottom=this.position.y+t.paddingBottom+"px",i.top=""),this.css(i),this.emitEvent("layout",[this])};var y=f?function(t,e){return"translate3d("+t+"px, "+e+"px, 0)"}:function(t,e){return"translate("+t+"px, "+e+"px)"};a.prototype._transitionTo=function(t,e){this.getPosition();var i=this.position.x,o=this.position.y,n=parseInt(t,10),r=parseInt(e,10),s=n===this.position.x&&r===this.position.y;if(this.setPosition(t,e),s&&!this.isTransitioning)return this.layoutPosition(),void 0;var a=t-i,u=e-o,p={},h=this.layout.options;a=h.isOriginLeft?a:-a,u=h.isOriginTop?u:-u,p.transform=y(a,u),this.transition({to:p,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},a.prototype.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},a.prototype.moveTo=h?a.prototype._transitionTo:a.prototype.goTo,a.prototype.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},a.prototype._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},a.prototype._transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return this._nonTransition(t),void 0;var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var o=this.element.offsetHeight;o=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var m=p&&o(p)+",opacity";a.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:m,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(c,this,!1))},a.prototype.transition=a.prototype[u?"_transition":"_nonTransition"],a.prototype.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},a.prototype.onotransitionend=function(t){this.ontransitionend(t)};var g={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};a.prototype.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,o=g[t.propertyName]||t.propertyName;if(delete e.ingProperties[o],i(e.ingProperties)&&this.disableTransition(),o in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[o]),o in e.onEnd){var n=e.onEnd[o];n.call(this),delete e.onEnd[o]}this.emitEvent("transitionEnd",[this])}},a.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(c,this,!1),this.isTransitioning=!1},a.prototype._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var v={transitionProperty:"",transitionDuration:""};return a.prototype.removeTransitionStyles=function(){this.css(v)},a.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.emitEvent("remove",[this])},a.prototype.remove=function(){if(!u||!parseFloat(this.layout.options.transitionDuration))return this.removeElem(),void 0;var t=this;this.on("transitionEnd",function(){return t.removeElem(),!0}),this.hide()},a.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options;this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0})},a.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options;this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:{opacity:function(){this.isHidden&&this.css({display:"none"})}}})},a.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},a}var r=t.getComputedStyle,s=r?function(t){return r(t,null)}:function(t){return t.currentStyle};"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property"],n):(t.Outlayer={},t.Outlayer.Item=n(t.EventEmitter,t.getSize,t.getStyleProperty))}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object Array]"===f.call(t)}function o(t){var e=[];if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var o=0,n=t.length;n>o;o++)e.push(t[o]);else e.push(t);return e}function n(t,e){var i=d(e,t);-1!==i&&e.splice(i,1)}function r(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()}function s(i,s,f,d,l,y){function m(t,i){if("string"==typeof t&&(t=a.querySelector(t)),!t||!c(t))return u&&u.error("Bad "+this.constructor.namespace+" element: "+t),void 0;this.element=t,this.options=e({},this.constructor.defaults),this.option(i);var o=++g;this.element.outlayerGUID=o,v[o]=this,this._create(),this.options.isInitLayout&&this.layout()}var g=0,v={};return m.namespace="outlayer",m.Item=y,m.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e(m.prototype,f.prototype),m.prototype.option=function(t){e(this.options,t)},m.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},m.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},m.prototype._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,o=[],n=0,r=e.length;r>n;n++){var s=e[n],a=new i(s,this);o.push(a)}return o},m.prototype._filterFindItemElements=function(t){t=o(t);for(var e=this.options.itemSelector,i=[],n=0,r=t.length;r>n;n++){var s=t[n];if(c(s))if(e){l(s,e)&&i.push(s);for(var a=s.querySelectorAll(e),u=0,p=a.length;p>u;u++)i.push(a[u])}else i.push(s)}return i},m.prototype.getItemElements=function(){for(var t=[],e=0,i=this.items.length;i>e;e++)t.push(this.items[e].element);return t},m.prototype.layout=function(){this._resetLayout(),this._manageStamps();var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,t),this._isLayoutInited=!0},m.prototype._init=m.prototype.layout,m.prototype._resetLayout=function(){this.getSize()},m.prototype.getSize=function(){this.size=d(this.element)},m.prototype._getMeasurement=function(t,e){var i,o=this.options[t];o?("string"==typeof o?i=this.element.querySelector(o):c(o)&&(i=o),this[t]=i?d(i)[e]:o):this[t]=0},m.prototype.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},m.prototype._getItemsForLayout=function(t){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i];n.isIgnored||e.push(n)}return e},m.prototype._layoutItems=function(t,e){function i(){o.emitEvent("layoutComplete",[o,t])}var o=this;if(!t||!t.length)return i(),void 0;this._itemsOn(t,"layout",i);for(var n=[],r=0,s=t.length;s>r;r++){var a=t[r],u=this._getItemLayoutPosition(a);u.item=a,u.isInstant=e||a.isLayoutInstant,n.push(u)}this._processLayoutQueue(n)},m.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},m.prototype._processLayoutQueue=function(t){for(var e=0,i=t.length;i>e;e++){var o=t[e];this._positionItem(o.item,o.x,o.y,o.isInstant)}},m.prototype._positionItem=function(t,e,i,o){o?t.goTo(e,i):t.moveTo(e,i)},m.prototype._postLayout=function(){this.resizeContainer()},m.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))}},m.prototype._getContainerSize=h,m.prototype._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},m.prototype._itemsOn=function(t,e,i){function o(){return n++,n===r&&i.call(s),!0}for(var n=0,r=t.length,s=this,a=0,u=t.length;u>a;a++){var p=t[a];p.on(e,o)}},m.prototype.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},m.prototype.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},m.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.concat(t);for(var e=0,i=t.length;i>e;e++){var o=t[e];this.ignore(o)}}},m.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;i>e;e++){var o=t[e];n(o,this.stamps),this.unignore(o)}},m.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o(t)):void 0},m.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var t=0,e=this.stamps.length;e>t;t++){var i=this.stamps[t];this._manageStamp(i)}}},m.prototype._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},m.prototype._manageStamp=h,m.prototype._getElementOffset=function(t){var e=t.getBoundingClientRect(),i=this._boundingRect,o=d(t),n={left:e.left-i.left-o.marginLeft,top:e.top-i.top-o.marginTop,right:i.right-e.right-o.marginRight,bottom:i.bottom-e.bottom-o.marginBottom};return n},m.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},m.prototype.bindResize=function(){this.isResizeBound||(i.bind(t,"resize",this),this.isResizeBound=!0)},m.prototype.unbindResize=function(){this.isResizeBound&&i.unbind(t,"resize",this),this.isResizeBound=!1},m.prototype.onresize=function(){function t(){e.resize(),delete e.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var e=this;this.resizeTimeout=setTimeout(t,100)},m.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},m.prototype.needsResizeLayout=function(){var t=d(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},m.prototype.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},m.prototype.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},m.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},m.prototype.reveal=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var o=t[i];o.reveal()}},m.prototype.hide=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var o=t[i];o.hide()}},m.prototype.getItem=function(t){for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];if(o.element===t)return o}},m.prototype.getItems=function(t){if(t&&t.length){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i],r=this.getItem(n);r&&e.push(r)}return e}},m.prototype.remove=function(t){t=o(t);var e=this.getItems(t);if(e&&e.length){this._itemsOn(e,"remove",function(){this.emitEvent("removeComplete",[this,e])});for(var i=0,r=e.length;r>i;i++){var s=e[i];s.remove(),n(s,this.items)}}},m.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];o.destroy()}this.unbindResize(),delete this.element.outlayerGUID,p&&p.removeData(this.element,this.constructor.namespace)},m.data=function(t){var e=t&&t.outlayerGUID;return e&&v[e]},m.create=function(t,i){function o(){m.apply(this,arguments)}return Object.create?o.prototype=Object.create(m.prototype):e(o.prototype,m.prototype),o.prototype.constructor=o,o.defaults=e({},m.defaults),e(o.defaults,i),o.prototype.settings={},o.namespace=t,o.data=m.data,o.Item=function(){y.apply(this,arguments)},o.Item.prototype=new y,s(function(){for(var e=r(t),i=a.querySelectorAll(".js-"+e),n="data-"+e+"-options",s=0,h=i.length;h>s;s++){var f,c=i[s],d=c.getAttribute(n);try{f=d&&JSON.parse(d)}catch(l){u&&u.error("Error parsing "+n+" on "+c.nodeName.toLowerCase()+(c.id?"#"+c.id:"")+": "+l);continue}var y=new o(c,f);p&&p.data(c,t,y)}}),p&&p.bridget&&p.bridget(t,o),o},m.Item=y,m}var a=t.document,u=t.console,p=t.jQuery,h=function(){},f=Object.prototype.toString,c="object"==typeof HTMLElement?function(t){return t instanceof HTMLElement}:function(t){return t&&"object"==typeof t&&1===t.nodeType&&"string"==typeof t.nodeName},d=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","doc-ready/doc-ready","eventEmitter/EventEmitter","get-size/get-size","matches-selector/matches-selector","./item"],s):t.Outlayer=s(t.eventie,t.docReady,t.EventEmitter,t.getSize,t.matchesSelector,t.Outlayer.Item)}(window),function(t){function e(t){function e(){t.Item.apply(this,arguments)}return e.prototype=new t.Item,e.prototype._create=function(){this.id=this.layout.itemGUID++,t.Item.prototype._create.call(this),this.sortData={}},e.prototype.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var t=this.layout.options.getSortData,e=this.layout._sorters;for(var i in t){var o=e[i];this.sortData[i]=o(this.element,this)}}},e}"function"==typeof define&&define.amd?define("isotope/js/item",["outlayer/outlayer"],e):(t.Isotope=t.Isotope||{},t.Isotope.Item=e(t.Outlayer))}(window),function(t){function e(t,e){function i(t){this.isotope=t,t&&(this.options=t.options[this.namespace],this.element=t.element,this.items=t.filteredItems,this.size=t.size)}return function(){function t(t){return function(){return e.prototype[t].apply(this.isotope,arguments)}}for(var o=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout"],n=0,r=o.length;r>n;n++){var s=o[n];i.prototype[s]=t(s)}}(),i.prototype.needsVerticalResizeLayout=function(){var e=t(this.isotope.element),i=this.isotope.size&&e;return i&&e.innerHeight!==this.isotope.size.innerHeight},i.prototype._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},i.prototype.getColumnWidth=function(){this.getSegmentSize("column","Width")},i.prototype.getRowHeight=function(){this.getSegmentSize("row","Height")},i.prototype.getSegmentSize=function(t,e){var i=t+e,o="outer"+e;if(this._getMeasurement(i,o),!this[i]){var n=this.getFirstItemSize();this[i]=n&&n[o]||this.isotope.size["inner"+e]}},i.prototype.getFirstItemSize=function(){var e=this.isotope.filteredItems[0];return e&&e.element&&t(e.element)},i.prototype.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},i.prototype.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},i.modes={},i.create=function(t,e){function o(){i.apply(this,arguments)}return o.prototype=new i,e&&(o.options=e),o.prototype.namespace=t,i.modes[t]=o,o},i}"function"==typeof define&&define.amd?define("isotope/js/layout-mode",["get-size/get-size","outlayer/outlayer"],e):(t.Isotope=t.Isotope||{},t.Isotope.LayoutMode=e(t.getSize,t.Outlayer))}(window),function(t){function e(t,e){var o=t.create("masonry");return o.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var t=this.cols;for(this.colYs=[];t--;)this.colYs.push(0);this.maxY=0},o.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}this.columnWidth+=this.gutter,this.cols=Math.floor((this.containerWidth+this.gutter)/this.columnWidth),this.cols=Math.max(this.cols,1)},o.prototype.getContainerWidth=function(){var t=this.options.isFitWidth?this.element.parentNode:this.element,i=e(t);this.containerWidth=i&&i.innerWidth},o.prototype._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,o=e&&1>e?"round":"ceil",n=Math[o](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var r=this._getColGroup(n),s=Math.min.apply(Math,r),a=i(r,s),u={x:this.columnWidth*a,y:s},p=s+t.size.outerHeight,h=this.cols+1-r.length,f=0;h>f;f++)this.colYs[a+f]=p;return u},o.prototype._getColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,o=0;i>o;o++){var n=this.colYs.slice(o,o+t);e[o]=Math.max.apply(Math,n)}return e},o.prototype._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this.options.isOriginLeft?o.left:o.right,r=n+i.outerWidth,s=Math.floor(n/this.columnWidth);s=Math.max(0,s);var a=Math.floor(r/this.columnWidth);a-=r%this.columnWidth?0:1,a=Math.min(this.cols-1,a);for(var u=(this.options.isOriginTop?o.top:o.bottom)+i.outerHeight,p=s;a>=p;p++)this.colYs[p]=Math.max(u,this.colYs[p])},o.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this.options.isFitWidth&&(t.width=this._getContainerFitWidth()),t},o.prototype._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.prototype.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!==this.containerWidth},o}var i=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++){var n=t[i];if(n===e)return i}return-1};"function"==typeof define&&define.amd?define("masonry/masonry",["outlayer/outlayer","get-size/get-size"],e):t.Masonry=e(t.Outlayer,t.getSize)}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t,i){var o=t.create("masonry"),n=o.prototype._getElementOffset,r=o.prototype.layout,s=o.prototype._getMeasurement;e(o.prototype,i.prototype),o.prototype._getElementOffset=n,o.prototype.layout=r,o.prototype._getMeasurement=s;var a=o.prototype.measureColumns;o.prototype.measureColumns=function(){this.items=this.isotope.filteredItems,a.call(this)};var u=o.prototype._manageStamp;return o.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,u.apply(this,arguments)},o}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/masonry",["../layout-mode","masonry/masonry"],i):i(t.Isotope.LayoutMode,t.Masonry)}(window),function(t){function e(t){var e=t.create("fitRows");return e.prototype._resetLayout=function(){this.x=0,this.y=0,this.maxY=0},e.prototype._getItemLayoutPosition=function(t){t.getSize(),0!==this.x&&t.size.outerWidth+this.x>this.isotope.size.innerWidth&&(this.x=0,this.y=this.maxY);var e={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=t.size.outerWidth,e},e.prototype._getContainerSize=function(){return{height:this.maxY}},e}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/fit-rows",["../layout-mode"],e):e(t.Isotope.LayoutMode)}(window),function(t){function e(t){var e=t.create("vertical",{horizontalAlignment:0});return e.prototype._resetLayout=function(){this.y=0},e.prototype._getItemLayoutPosition=function(t){t.getSize();var e=(this.isotope.size.innerWidth-t.size.outerWidth)*this.options.horizontalAlignment,i=this.y;return this.y+=t.size.outerHeight,{x:e,y:i}},e.prototype._getContainerSize=function(){return{height:this.y}},e}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/vertical",["../layout-mode"],e):e(t.Isotope.LayoutMode)}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object Array]"===h.call(t)}function o(t){var e=[];if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var o=0,n=t.length;n>o;o++)e.push(t[o]);else e.push(t);return e}function n(t,e){var i=f(e,t);-1!==i&&e.splice(i,1)}function r(t,i,r,u,h){function f(t,e){return function(i,o){for(var n=0,r=t.length;r>n;n++){var s=t[n],a=i.sortData[s],u=o.sortData[s];if(a>u||u>a){var p=void 0!==e[s]?e[s]:e,h=p?1:-1;return(a>u?1:-1)*h}}return 0}}var c=t.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});c.Item=u,c.LayoutMode=h,c.prototype._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),t.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var e in h.modes)this._initLayoutMode(e)},c.prototype.reloadItems=function(){this.itemGUID=0,t.prototype.reloadItems.call(this)},c.prototype._itemize=function(){for(var e=t.prototype._itemize.apply(this,arguments),i=0,o=e.length;o>i;i++){var n=e[i];n.id=this.itemGUID++}return this._updateItemsSortData(e),e},c.prototype._initLayoutMode=function(t){var i=h.modes[t],o=this.options[t]||{};this.options[t]=i.options?e(i.options,o):o,this.modes[t]=new i(this)},c.prototype.layout=function(){return!this._isLayoutInited&&this.options.isInitLayout?(this.arrange(),void 0):(this._layout(),void 0)},c.prototype._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},c.prototype.arrange=function(t){this.option(t),this._getIsInstant(),this.filteredItems=this._filter(this.items),this._sort(),this._layout()},c.prototype._init=c.prototype.arrange,c.prototype._getIsInstant=function(){var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;return this._isInstant=t,t},c.prototype._filter=function(t){function e(){f.reveal(n),f.hide(r)}var i=this.options.filter;i=i||"*";for(var o=[],n=[],r=[],s=this._getFilterTest(i),a=0,u=t.length;u>a;a++){var p=t[a];if(!p.isIgnored){var h=s(p);h&&o.push(p),h&&p.isHidden?n.push(p):h||p.isHidden||r.push(p)}}var f=this;return this._isInstant?this._noTransition(e):e(),o},c.prototype._getFilterTest=function(t){return s&&this.options.isJQueryFiltering?function(e){return s(e.element).is(t)}:"function"==typeof t?function(e){return t(e.element)}:function(e){return r(e.element,t)}},c.prototype.updateSortData=function(t){this._getSorters(),t=o(t);var e=this.getItems(t);e=e.length?e:this.items,this._updateItemsSortData(e) },c.prototype._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=d(i)}},c.prototype._updateItemsSortData=function(t){for(var e=0,i=t.length;i>e;e++){var o=t[e];o.updateSortData()}};var d=function(){function t(t){if("string"!=typeof t)return t;var i=a(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),r=n&&n[1],s=e(r,o),u=c.sortDataParsers[i[1]];return t=u?function(t){return t&&u(s(t))}:function(t){return t&&s(t)}}function e(t,e){var i;return i=t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&p(i)}}return t}();c.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},c.prototype._sort=function(){var t=this.options.sortBy;if(t){var e=[].concat.apply(t,this.sortHistory),i=f(e,this.options.sortAscending);this.filteredItems.sort(i),t!==this.sortHistory[0]&&this.sortHistory.unshift(t)}},c.prototype._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw Error("No layout mode: "+t);return e.options=this.options[t],e},c.prototype._resetLayout=function(){t.prototype._resetLayout.call(this),this._mode()._resetLayout()},c.prototype._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},c.prototype._manageStamp=function(t){this._mode()._manageStamp(t)},c.prototype._getContainerSize=function(){return this._mode()._getContainerSize()},c.prototype.needsResizeLayout=function(){return this._mode().needsResizeLayout()},c.prototype.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},c.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps();var o=this._filterRevealAdded(e);this.layoutItems(i),this.filteredItems=o.concat(this.filteredItems)}},c.prototype._filterRevealAdded=function(t){var e=this._noTransition(function(){return this._filter(t)});return this.layoutItems(e,!0),this.reveal(e),t},c.prototype.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;n>i;i++)o=e[i],this.element.appendChild(o.element);var r=this._filter(e);for(this._noTransition(function(){this.hide(r)}),i=0;n>i;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;n>i;i++)delete e[i].isLayoutInstant;this.reveal(r)}};var l=c.prototype.remove;return c.prototype.remove=function(t){t=o(t);var e=this.getItems(t);if(l.call(this,t),e&&e.length)for(var i=0,r=e.length;r>i;i++){var s=e[i];n(s,this.filteredItems)}},c.prototype._noTransition=function(t){var e=this.options.transitionDuration;this.options.transitionDuration=0;var i=t.call(this);return this.options.transitionDuration=e,i},c}var s=t.jQuery,a=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},u=document.documentElement,p=u.textContent?function(t){return t.textContent}:function(t){return t.innerText},h=Object.prototype.toString,f=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","matches-selector/matches-selector","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],r):t.Isotope=r(t.Outlayer,t.getSize,t.matchesSelector,t.Isotope.Item,t.Isotope.LayoutMode)}(window); (function(c,b,d){c.HoverDir=function(e,f){this.$el=c(f);this._init(e)};c.HoverDir.defaults={speed:300,easing:"ease",hoverDelay:0,hoverElement:".info",inverse:false};c.HoverDir.prototype={_init:function(e){this.options=c.extend(true,{},c.HoverDir.defaults,e);this.transitionProp="all "+this.options.speed+"ms "+this.options.easing;this.support=b.Modernizr?Modernizr.csstransitions:false;this._loadEvents()},_loadEvents:function(){var e=this;this.$el.on("mouseenter.hoverdir, mouseleave.hoverdir",function(i){var g=c(this),f=g.find(e.options.hoverElement),j=e._getDir(g,{x:i.pageX,y:i.pageY}),h=e._getStyle(j);if(i.type==="mouseenter"){f.hide().css(h.from);clearTimeout(e.tmhover);e.tmhover=setTimeout(function(){f.show(0,function(){var k=c(this);if(e.support){k.css("transition",e.transitionProp)}e._applyAnimation(k,h.to,e.options.speed)})},e.options.hoverDelay)}else{if(e.support){f.css("transition",e.transitionProp)}clearTimeout(e.tmhover);e._applyAnimation(f,h.from,e.options.speed)}})},_getDir:function(g,k){var f=g.width(),i=g.height(),e=(k.x-g.offset().left-(f/2))*(f>i?(i/f):1),l=(k.y-g.offset().top-(i/2))*(i>f?(f/i):1),j=Math.round((((Math.atan2(l,e)*(180/Math.PI))+180)/90)+3)%4;return j},_getStyle:function(k){var g,l,i={left:"0px",top:"-100%"},e={left:"0px",top:"100%"},h={left:"-100%",top:"0px"},f={left:"100%",top:"0px"},m={top:"0px"},j={left:"0px"};switch(k){case 0:g=!this.options.inverse?i:e;l=m;break;case 1:g=!this.options.inverse?f:h;l=j;break;case 2:g=!this.options.inverse?e:i;l=m;break;case 3:g=!this.options.inverse?h:f;l=j;break}return{from:g,to:l}},_applyAnimation:function(f,e,g){c.fn.applyStyle=this.support?c.fn.css:c.fn.animate;f.stop().applyStyle(e,c.extend(true,[],{duration:g+"ms"}))}};var a=function(e){if(b.console){b.console.error(e)}};c.fn.hoverdir=function(g){var e=c.data(this,"hoverdir");if(typeof g==="string"){var f=Array.prototype.slice.call(arguments,1);this.each(function(){if(!e){a("cannot call methods on hoverdir prior to initialization; attempted to call method '"+g+"'");return}if(!c.isFunction(e[g])||g.charAt(0)==="_"){a("no such method '"+g+"' for hoverdir instance");return}e[g].apply(e,f)})}else{this.each(function(){if(e){e._init()}else{e=c.data(this,"hoverdir",new c.HoverDir(g,this))}})}return e}})(jQuery,window);